<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE sqlMap      
    PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"      
    "http://ibatis.apache.org/dtd/sql-map-2.dtd">

<sqlMap namespace="${class.package}.${class.name}">

${plugin.getAlias(class)}

<#list class.methods as methods>
<#if methods.getTagByName("ibatis.result-map")??>
${plugin.getResultMap(methods)}
</#if>
</#list>


<#list class.methods as methods>
	<#if methods.getTagByName("ibatis.sql")??>
		<#if methods.getTagByName("ibatis.map")??>
			<#if plugin.getType(methods) == 'select'>
<select ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</select>
			</#if>
			<#if plugin.getType(methods) == 'insert'>
<insert ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</insert>
			</#if>
			<#if plugin.getType(methods) == 'update'>
<update ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</update>
			</#if>
			<#if plugin.getType(methods) == 'delete'>
<delete ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</delete>
			</#if>
			<#if plugin.getType(methods) == 'procedure'>
<procedure ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</procedure>
			</#if>
			<#if plugin.getType(methods) == 'statement'>
<statement ${plugin.getMap(methods)}>
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</statement>
			</#if>
		<#else>
<statement id="${methods.name}" parameterClass="java.util.Map" resultClass="java.util.Map">
	<![CDATA[
${plugin.getSql(methods)}
	]]>
</statement>
		</#if>
	</#if>
</#list>

</sqlMap>